#!/bin/bash

set -ex

# 拉取仓库.
# REPO_ROOT_PATH : git仓库存储的路劲

# 创建 repopath
if [[ ! -d ${REPO_ROOT_PATH} ]] ; then
    mkdir -p ${REPO_ROOT_PATH}
fi

cd ${REPO_ROOT_PATH}


if [[ ! -d ${REPO_FULL_NAME} ]] ; then
    # 创建用户的文件夹.
    mkdir -p ${REPO_FULL_NAME} && cd ${REPO_FULL_NAME}
    git clone ${CLONE_URL} .
else
    cd ${REPO_FULL_NAME}
    git pull
fi



